import numpy as np
a=[1,2,3,np.NaN]

for i in range(len(a)):
    if np.isnan(a[i]):
        print(i)
        del a[i]
print(a)